

//$debug.setMemoryLeakDetectionEnabled(false);//关闭内存泄露检测
// requestScreenCapture();//请求截图权限
var 申请截图权限 = images.requestScreenCapture();
if (!申请截图权限) {
    console.log("申请截图权限不成功");
    exit();
} else {
    console.log("运行成功");
}

let 图标_右边X = ["autojs/999/189","#ffffff",[[-16,-17,"#ffffff"],[17,-17,"#ffffff"],[-14,15,"#ffffff"],[16,15,"#ffffff"],[7,-7,"#ffffff"]],{region:[950,150,200,100],threshold:[26]}];
let 图标_左边直播X = ["autojs/834/2217","#919191",[[7,-6,"#919191"],[17,-16,"#919191"],[7,7,"#919191"],[18,18,"#919191"]],{region:[810,2180,50,60],threshold:[26]}];
let 图标_左边看书X = ["autojs/54/117","#ffffff",[[5,6,"#ffffff"],[13,13,"#ffffff"],[11,-1,"#ffffff"],[-1,12,"#ffffff"]],{region:[1,1,100,170],threshold:[26]}];

let 图标_关闭 = ["autojs/956/73","#ffffff",[[15,0,"#ffffff"],[9,9,"#ffffff"],[-1,20,"#ffffff"],[19,20,"#ffffff"],[41,-5,"#ffffff"],[54,21,"#ffffff"],[46,7,"#ffffff"],[30,21,"#ffffff"]],{region:[901,22,159,128],threshold:[26]}];
if (多点找色点击(图标_关闭)) {
    toastLog('找到图标');
  }else{
    toastLog('没有找到图标');
  }

function 多点找色点击(多点信息){
    let res = false;
    let img = images.captureScreen();//截屏
    sleep(200);//延迟一下，截图太快会卡顿
    let p = images.findMultiColors(img,多点信息[1],多点信息[2],多点信息[3]);
    if(p){
        点击(p.x,p.y,1000);
        res = true;
    }
    img.recycle();//释放内存
    return res;
}

function 点击(intX, intY, sleepTime) {
    click(intX, intY);
    sleep(sleepTime);
}